package com.mall.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mall.pojo.Category;
import com.mall.pojo.Wares;
import com.mall.vo.SearchCategoryVo;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author xiao-chen
 * @since 2023-04-20
 */
public interface ICategoryService extends IService<Category> {
    /**
     * 根据类别ID获取该类别下的所有商品
     *
     * @param categoryId
     * @return java.util.List<com.mall.pojo.Wares>
     * @author cxx
     * @date 2023/6/1 10:20
     */
    Page<Wares> getWaresByCategory(String categoryId, Integer page, Integer pageSize);

    /**
     * 将商品级别以树形结构展示出来
     *
     * @param
     * @return java.util.List<com.mall.DTO.CategoryDTO>
     * @author cxx
     * @date 2023/6/1 10:27
     */

    List<SearchCategoryVo> listCategoryWithTree();

    /**
     * 通过商品id获取商品分类名
     *
     * @param wareId
     * @return java.lang.String
     * @author cxx
     * @date 2023/6/2 9:12
     */
    String getCategoryNameByWareId(Long wareId);

    Long getCategoryIdByName(String name);
}
